package com.itrus.spring.transaction;

import com.itrus.spring.transaction.config.TransactionApp;
import com.itrus.spring.transaction.service.FirstService;
import com.itrus.spring.transaction.service.SecondService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class Main {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TransactionApp.class);
        /**
         * AbstractAutowireCapableBeanFactory.doCreateBean 方法中：
         * 如果对象在属性注入过程（populateBean）中被修改，并且当前 bean 会被注入到其他的 bean
         */
        FirstService firstService = context.getBean(FirstService.class);
        firstService.execute();
    }
}
